package com.pet.entity;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
@TableName("pets")
public class PetDO {
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 用户名
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 宠物名称
     */
    @TableField("name")
    private String name;

    /**
     * 品种
     */
    @TableField("breed")
    private String breed;

    /**
     * 出生日期
     */
    @TableField("birth_date")
    @JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN, timezone = "GMT+8")
    private Date birthDate;

    /**
     * 领养日期
     */
    @TableField("adoption_date")
    @JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN, timezone = "GMT+8")
    private Date adoptionDate;

    /**
     * 性别
     */
    @TableField("gender")
    private String gender;

    /**
     * 体重
     */
    @TableField("weight")
    private Double weight;

    /**
     * 是否绝育
     */
    @TableField("sterilized")
    private Integer sterilized;

    /**
     * 是否接种疫苗
     */
    @TableField("vaccinated")
    private Integer vaccinated;

    /**
     * 头像
     */
    @TableField("avatar")
    private String avatar;

    /**
     * 创建时间
     */
    @TableField("created_at")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
    private Date createdAt;

    /**
     * 更新时间
     */
    @TableField("updated_at")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone = "GMT+8")
    private Date updatedAt;
}
